package com.itheima.controller;


import com.itheima.pojo.domain.ClazzOption;
import com.itheima.pojo.domain.GenderOption;
import com.itheima.pojo.domain.JobOption;
import com.itheima.pojo.Result;
import com.itheima.service.ReportService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;


@RestController
@RequestMapping("/report")
@Slf4j
public class ReportController {
    @Autowired
    private ReportService reportService;

    /**
     * 员工职位统计
     * @return
     */
    @GetMapping("/empJobData")
    public Result empPositionStatistics(){
        log.info("员工职位统计");
        JobOption list  = reportService.empPositionStatistics();

        return Result.success(list);
    }

    /**
     * 员工性别统计
     * @return
     */
    @GetMapping("/empGenderData")
    public Result empGenderStatistics(){
        log.info("员工性别统计");
        List<GenderOption> list  = reportService.empGenderStatistics();

        return Result.success(list);
    }
    /**
     * 学员学历统计
     * @return
     * @author ayao
     */
    @GetMapping("/studentDegreeData")
    public Result empEducationStatistics(){
        log.info("员工学历统计");
        List<GenderOption> list  = reportService.empEducationStatistics();

        return Result.success(list);
    }

    /**
     * 班级人数统计
     * @return
     */
    @GetMapping("/studentCountData")
    public Result empCountStatistics(){
        log.info("员工统计");
        ClazzOption list  = reportService.empCountStatistics();

        return Result.success(list);
    }


}
